<template>
  <div class="banner">
    <el-carousel height="460px">
      <el-carousel-item v-for="(item, index) in list" :key="index">
        <img :src="'http://39.100.7.70:81/' + item.imgPath" alt="" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
import bannerApi from "@/api/index.js";
export default {
  name: "",
  data() {
    return {
      list:[]
    };
  },
  created(){
    this.getBanner()
  },
  methods: {
    //获取轮播图
    async getBanner() {
      let { data: res } = await bannerApi.getBanner();
      console.log(res.carousel);
      this.list = res.carousel;
    },

  },
  computed: {},
  watch: {},
};
</script>

<style lang="scss" scoped>
.banner{
   width: 85%;
   margin: 0 auto;
}
</style>